package com.asyyy.shixun.community;

import android.graphics.Color;
import android.view.Gravity;
import android.view.View;
import android.webkit.WebView;
import android.widget.ListView;
import android.widget.TextView;

import com.asyyy.shixun.R;
import com.asyyy.shixun.base.BaseFragment;
import com.asyyy.shixun.home.Goods;

import java.util.ArrayList;

public class CommunityFragment extends BaseFragment {

    private ListView shop_list;

    @Override
    public View initView() {
        View view = View.inflate(mContext, R.layout.fragment_community, null);
        shop_list = view.findViewById(R.id.shop_list);
        return view;
    }

    public void initData(){
        super.initData();
        ArrayList<Shop> shops = new ArrayList<>();
        Goods s1_goods1 = new Goods(R.drawable.xiaomi10,"小米10",2999.00);
        Goods s1_goods2 = new Goods(R.drawable.xiaomi10,"小米10 Pro",3999.00);
        Goods s1_goods3 = new Goods(R.drawable.xiaomi10,"小米10 Pro 12+512",4999.00);
        shops.add(new Shop(R.drawable.mi,"小米旗舰店",s1_goods1,s1_goods2,s1_goods3));

        Goods s2_goods1 = new Goods(R.drawable.ipad,"IPad2018金色",2599.00);
        Goods s2_goods2 = new Goods(R.drawable.ipad2,"IPad2018银色",2399.00);
        Goods s2_goods3 = new Goods(R.drawable.ipad3,"IPad Pro 11英寸",6999.00);
        shops.add(new Shop(R.drawable.apple,"Apple旗舰店",s2_goods1,s2_goods2,s2_goods3));

        ShopListAdapter adapter = new ShopListAdapter(mContext, shops);
        shop_list.setAdapter(adapter);
    }
}
